﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Principal.aspx.cs" Inherits="entgpguayas.Principal" %>

<%@ Register Src="Usuarios/wucUsuarios.ascx" TagName="wucUsuarios" TagPrefix="uc1" %>
<%@ Import Namespace="System.Collections.Generic" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>ENT-Project Management - Sistema de Administracion de Proyectos</title>
    <link rel="stylesheet" type="text/css" href="resources/css/main.css" />
     <style type="text/css">
       
    </style>
</head>
<body>
    <%--<form id="form1" runat="server">--%>
    <ext:ResourceManager ID="ResourceManager1" runat="server" />
    
    <script type="text/javascript" language="javascript">
        var redirect = function () {
            document.location = 'Default.aspx';
        };
        //window.status = '**';
        crearTab = function (path, id, url, text) {
            var win, tab, hostName, exampleName, node, nombre;

            if (id == "-") {
                id = Ext.id();
                nombre = url;
                url = "/Modulos" + url;
            }

            hostName = window.location.protocol + "//" + window.location.host;
            exampleName = url.substr(9);
            //Creacion del tab
            tab = NavegacionTabs.add(new Ext.Panel({
                id: id,
                tbar: [{
                    text: path,
                    iconCls: 'icon-pagewhitecode'
                },
            '->',
            {
                text: 'Recargar',
                handler: function () {
                    Ext.getCmp(id).reload(true);
                    //alert('ok');
                },
                iconCls: 'icon-arrow-refresh'
            }],
                title: text,
                autoLoad: {
                    showMask: true,
                    scripts: true,
                    mode: "iframe",
                    url: hostName + url
                },
                listeners: {
                    deactivate: {
                        fn: function (el) {
                            if (this.sWin && this.sWin.isVisible()) {
                                this.sWin.hide();
                            }
                        }



                        //onMouseOver="window.status='Vente a mi pásgina';return true"



                    }

                },
                closable: true
            }));

            tab.sWin = win;
            NavegacionTabs.setActiveTab(tab);
        }



        //Funcion para crear un nuevo tab o poner como activo al tab si no existe 
        cargarTab = function(path, href, id, text) {
            var tab = NavegacionTabs.getComponent(id);

            if (tab) {
                NavegacionTabs.setActiveTab(tab);
            } else {
                crearTab(path, id, href, text);
            }

        }

        //JSA. Llamada de prodecimiento desde las paginas internas...
        var CargarURL = function(path, href, id, text) {
            var tab = NavegacionTabs.getComponent(id);
            if (tab) {
                NavegacionTabs.setActiveTab(tab);
            } else {
                crearTab(path, id, href, text);
            }
        }

        var panel;
        var acc;
        var selectionChaged = function(dv, nodes) {
            if (nodes.length > 0) {
                var url = nodes[0].getAttribute("ext:url"),
                    id = nodes[0].getAttribute("ext:id"),
                    nombre = nodes[0].getAttribute("ext:nombre"),
                    idpadre = nodes[0].getAttribute("ext:idpadre"),
                    idref = nodes[0].getAttribute("ext:idref");
                pnlOeste.expand();
                Ext.getCmp(idref).expand();
            }
        }

        var viewClick = function(dv, e) {
            var group = e.getTarget("h2", 3, true);

            if (group) {
                group.up("div").toggleClass("collapsed");
            }
        }

        var plugInSetEvt = function (evt) {

            var plugInPanel_Container = document.getElementById("videoHelp");
            if (plugInPanel_Container != null) {
                switch (evt) {
                    case 'pause': plugInPanel_Container.pause(); break;
                    case 'play': plugInPanel_Container.play(); break;
                }

            }

        }
    </script>
    <ext:Store ID="Store1" runat="server" AutoLoad="true" SerializationMode="Complex" 
        OnRefreshData="RefreshHomeTabData">
        <Proxy>
            <ext:PageProxy />
        </Proxy>
        <DirectEventConfig Method="GET" />
        <Reader>
            <ext:JsonReader>
                <Fields>
                    <ext:RecordField Name="id" />
                    <ext:RecordField Name="title" />
                    <ext:RecordField Name="enlaces" />
                </Fields>
            </ext:JsonReader>
        </Reader>
        <%--<Listeners>
            <BeforeLoad Handler="#{tabHome}.body.mask('Cargando...', 'x-mask-loading');" />
            <Load Handler="#{tabHome}.body.unmask();" />
            <LoadException Handler="#{tabHome}.body.unmask();" />
        </Listeners>--%>
    </ext:Store>
    <ext:Viewport ID="Viewport1" runat="server">
        <Items>
            <ext:BorderLayout runat="server">
                <North>
                    <ext:Panel runat="server" Border="false">
                        <Items>                            
                        </Items>
                        <BottomBar>
                            <ext:StatusBar runat="server">
                                <Items>
                                   <ext:Button ID="btnFlujo"  runat="server" Icon="Help">
                                        <DirectEvents>
                                            <Click OnEvent="verFlujo_Click">
                                            </Click>
                                        </DirectEvents>
                                   
                                   </ext:Button>
                                   <ext:LinkButton ID="lkFlujo" runat="server" Text="Flugo General">
                                        <DirectEvents>
                                            <Click OnEvent="verFlujo_Click">
                                            </Click>
                                        </DirectEvents>
                                    </ext:LinkButton>
                                    <ext:Label ID="Label3" runat="server" Html="&nbsp;&nbsp;&nbsp;"></ext:Label>
                                    <ext:Label ID="lblUserIco" runat="server" Icon="UserStar"/>
                                    <ext:Label ID="lblUser" Hidden="true" runat="server">
                                    </ext:Label>
                                    <ext:Label ID="lblNombre" runat="server">
                                    </ext:Label>
                                    <ext:Label runat="server" Html="&nbsp;&nbsp;"></ext:Label>
                                    <ext:Label ID="lblRol" runat="server">
                                    </ext:Label>
                                    <ext:Label ID="Label1" runat="server" Html="&nbsp;&nbsp;"></ext:Label>
                                    <ext:Label ID="Label4" runat="server" Icon="Vcard" />
                                    <ext:LinkButton runat="server" Text="Mi Cuenta">
                                        <DirectEvents>
                                            <Click OnEvent="verMiCuenta_Click">
                                            </Click>
                                        </DirectEvents>
                                    </ext:LinkButton>
                                    <ext:Label ID="Label2" runat="server" Html="&nbsp;&nbsp;"></ext:Label>
                                     <ext:Label ID="Label5" runat="server" Icon="ServerGo" />
                                    <ext:LinkButton runat="server" Text="Salir">
                                        <DirectEvents>
                                            <Click OnEvent="btnSalirENTPM_Click">
                                            </Click>
                                        </DirectEvents>
                                    </ext:LinkButton>
                                </Items>
                            </ext:StatusBar>
                        </BottomBar>
                    </ext:Panel>
                </North>
                <West Collapsible="true" Split="true" CollapseMode="Mini" >               
                    <ext:Panel runat="server" Header="false" Border="false" Width="200" ID="pnlOeste" >
                        <Items>
                        
                        </Items>
                        <TopBar>
                        <ext:Toolbar Cls="x-toolbar1" runat="server">
                        <Items>
                        <ext:Image runat="server" ID="ImageLogo" ImageUrl="resources/images/logoentv2.png" Width="200" Height="100"></ext:Image>
                        </Items>
                        </ext:Toolbar>
                        </TopBar>
                        
                    </ext:Panel>
                </West>
                <Center>
                    <ext:TabPanel ID="NavegacionTabs" runat="server" ActiveTabIndex="0" EnableTabScroll="true">
                        <Items>
                            <ext:Panel ID="tabHome" runat="server" IconCls="icon-application" Title="Principal"
                                AutoScroll="true">
                                <Items>
                                    <ext:Panel ID="Panel1" runat="server" BodyStyle="padding:15px" Border="false">
                                        <Items>
                                                    <ext:FieldSet ID="FieldSet1" Title="Módulos" Collapsible="true" runat="server">
                                                        <Items>
                                                            <ext:Panel ID="ImagePanel" runat="server" Cls="images-view" Border="false" AutoHeight="true"
                                                                FormGroup="true">
                                                                <Items>
                                                                    <ext:FitLayout ID="FitLayout1" runat="server">
                                                                    <Items>
                                                                        <ext:DataView ID="DataView1" IDMode="Ignore" runat="server" StoreID="Store1" SingleSelect="true"
                                                                            OverClass="x-view-over" ItemSelector="div.thumb-wrap" AutoHeight="true" EmptyText="No hay elementos que mostrar">
                                                                            <Template ID="Template1" runat="server">
                                                                            <Html>
                                                                            <div id="sample-ct">
	                                                                            <tpl for=".">
	                                                                                <div>
	                                                                                    <dl>
		                                                                                    <tpl for="enlaces">
			                                                                                    <div class="thumb-wrap" ext:url="{Url}" ext:id="{id}" ext:nombre="{nombre}" ext:idpadre="{idpadre}" ext:idref="{idref}">
	                                                                                                <img src="{imgUrl}" title="{nombreEx}" />
	                                                                                                <div>
	                                                                                                    
	                                                                                                    <h4>{nombreEx}</h4>
                                                                                                        <p>{descr}</p>
	                                                                                                </div>
                                                                                                </div>
		                                                                                    </tpl>
	                                                                                        <div style="clear:left"></div>
	                                                                                     </dl>
	                                                                                </div>
	                                                                            </tpl>
                                                                            </div></Html>
                                                                            </Template>
                                                                            <Listeners>
                                                                                <SelectionChange Fn="selectionChaged" />
                                                                                <ContainerClick Fn="viewClick" />
                                                                            </Listeners>
                                                                        </ext:DataView>
                                                                        </Items>
                                                                    </ext:FitLayout>
                                                                </Items>
                                                            </ext:Panel>
                                                        </Items>
                                                    </ext:FieldSet>
                                                <%--</ext:Anchor>
                                            </ext:FormLayout>--%>
                                        </Items>
                                    </ext:Panel>
                                </Items>
                            </ext:Panel>
                        </Items>
                        <Plugins>
                            <ext:TabCloseMenu runat="server" ID="ctl382" />
                        </Plugins>
                    </ext:TabPanel>
                </Center>
                <South>
                    <ext:Panel runat="server" Border="false">
                        <Content> <center>
                                <a style="font-size: x-small;" href="http://www.enovatraining.com" target="_blank">Powered
                                    by Enovatraining Cia. Ltda.</a>
                            </center>
                        </Content>
                        <Items>

                           
                        </Items>
                    </ext:Panel>
                </South>
            </ext:BorderLayout>
        </Items>
    </ext:Viewport>
    <uc1:wucUsuarios runat="server" ID="wucUsuarios1" />
    <ext:Window runat="server" ID="winFlujo" Modal="true" Height="500" 
    Width="600" Hidden="true" CenterOnLoad="true" Resizable="false" ButtonAlign="Center">
        <Items>
             <ext:GroupTabPanel ID="GroupTabPanelHelp" runat="server" Width="600" Height="450" TabWidth="130" ActiveGroupIndex="0">
                <Groups>
                    <ext:GroupTab  runat="server" MainItem="1" >
                        <Items>
                            <ext:Panel  
                                runat="server" 
                                Title="Video" 
                                Layout="fit" 
                                Icon="Note" 
                                TabTip="Video"
                                Padding="10">
                                <Content>
                                    <div>
                                     
                                   </div>
                                    
                                </Content>
                            </ext:Panel>
                            <ext:Portal 
                                runat="server" 
                                Title="Flujo General" 
                                TabTip="Ayuda" 
                                Layout="Column">
                                <Items>
                                  
                                </Items>
                            </ext:Portal>
                            
                        </Items>
                    </ext:GroupTab>
                  
                </Groups>
                
            </ext:GroupTabPanel>
        </Items>
        <Buttons>
                <ext:Button ID="btnCancelar" runat="server" Text="Aceptar">
                                <Listeners>
                                    <Click Handler="plugInSetEvt('pause');#{winFlujo}.hide(); " />
                                </Listeners>
                </ext:Button>
       </Buttons>
    </ext:Window>





    <%--</form>--%>
</body>
</html>
